/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.tspp.dao.dto;

import java.io.Serializable;
import java.sql.Date;

/**
 * Transfer object for Exam table(DAO pattern)
 * @author Maks
 */
public class Exam implements Serializable {

    /**  This attribute maps to the column ID_EXAM in the EXAM table.*/
    private int idExam;

    /**  This attribute maps to the column ID_SPECIALITY in the EXAM table.*/
    private int idSpeciality;

    /**  This attribute maps to the column SUBJECT in the EXAM table.*/
    private String subject;

    /**  This attribute maps to the column TYPE in the EXAM table.*/
    private String type;

    /**  This attribute maps to the column MAX_POINTS in the EXAM table.*/
    private int maxPoints;

    /** This attribute maps to the column DATE_TIME in the EXAM table.*/
    private Date dateTime;

    /** This attribute maps to the column ADDRESS in the EXAM table.*/
    private String address;


    /**
     * Return value of the column ID_EXAM in the EXAM table
     * @return int id of current exam
     */
    public int getIdExam() {
        return idExam;
    }

    /**
     * Set the id of exam
     * @param idExam
     */
    public void setIdExam(int idExam) {
        this.idExam = idExam;
    }

    /**
     * Return value of the column ID_SPECIALITY in the EXAM table
     * @return int id of speciality of current exam
     */
    public int getIdSpeciality() {
        return idSpeciality;
    }

    /**
     * Set id of speciality
     * @param idSpeciality
     */
    public void setIdSpeciality(int idSpeciality) {
        this.idSpeciality = idSpeciality;
    }



    /**
     * Return value of the column SUBJECT in the EXAM table
     * @return String exam's subject
     */
    public String getSubject() {
        return subject;
    }

    /**
     * Set the subject of exam
     * @param subject
     */
    public void setSubject(String subject) {
        this.subject = subject;
    }

    /**
     * Return value of the column TYPE in the EXAM table
     * @return String type of subject of current exam
     */
    public String getType() {
        return type;
    }

    /**
     * Set the type of subject of exam
     * @param type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * Return value of the column MAX_POINTS in the EXAM table
     * @return int maximum points for exam
     */
    public int getMaxPoints() {
        return maxPoints;
    }

    /**
     * set maximum points for exam
     * @param maxPoints
     */
    public void setMaxPoints(int maxPoints) {
        this.maxPoints = maxPoints;
    }

    /**
     * Return value of the column DATE_TIME in the EXAM table
     * @return Date date of exam
     */
    public Date getDateTime() {
        return dateTime;
    }

    /**
     * Set the date of exam
     * @param dateTime date of exam
     */
    public void setDateTime(Date dateTime) {
        this.dateTime = dateTime;
    }

    /**
     * Return value of the column ADDRESS in the EXAM table
     * @return String address of current exam
     */
    public String getAddress() {
        return address;
    }

    /**
     * Set the address of exam
     * @param address address of exam
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    @Override
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof Exam)) {
            return false;
        }

        final Exam _cast = (Exam) _other;
        if (idExam != _cast.idExam) {
            return false;
        }

        if (idSpeciality != _cast.idSpeciality) {
            return false;
        }

        if (subject == null ? !_cast.subject.equals(subject) : !subject.equals(_cast.subject)) {
            return false;
        }

        if (type == null ? !_cast.type.equals(type) : !type.equals(_cast.type)) {
            return false;
        }

        if (maxPoints != _cast.maxPoints) {
            return false;
        }

        if (dateTime == null ? _cast.dateTime != dateTime : !dateTime.equals(_cast.dateTime)) {
            return false;
        }

        if (address == null ? !_cast.address.equals(address) : !address.equals(_cast.address)) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    @Override
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + idExam;
        _hashCode = 29 * _hashCode + idSpeciality;
        if (subject != null) {
            _hashCode = 29 * _hashCode + subject.hashCode();
        }

        if (type != null) {
            _hashCode = 29 * _hashCode + type.hashCode();
        }

        _hashCode = 29 * _hashCode + maxPoints;
        if (dateTime != null) {
            _hashCode = 29 * _hashCode + dateTime.hashCode();
        }

        if (address != null) {
            _hashCode = 29 * _hashCode + address.hashCode();
        }

        return _hashCode;
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    @Override
    public String toString() {
        StringBuilder ret = new StringBuilder();
        ret.append("com.tspp.dao.dto.Exam: ");
        ret.append("idExam=").append(idExam);
        ret.append(", idSpeciality=").append(idSpeciality);
        ret.append(", subject=").append(subject);
        ret.append(", type=").append(type);
        ret.append(", maxPoints=").append(maxPoints);
        ret.append(", dateTime=").append(dateTime);
        ret.append(", address=").append(address);
        return ret.toString();
    }
}
